/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package book.test;

/**
 *
 * @author Administrator
 */
public class Timer {
    private int hh,mm,ss;
    public int getHh(){
        if(hh>0&&hh<12){
            return hh;
        }
        else if(hh>=12&&hh<24){
            return hh-12;
        }
        else{
            return 0;
        }
    }
    public int getMm(){return mm;}
    public int getSs(){return ss;}
    public void setHh(int hh){
        if(hh>=0&&hh<24){
            this.hh=hh;
        }
    }
    public void setMm(int mm){
        if(mm>=0&&mm<60){
            this.mm=mm;
        }
    }
    public void setSs(int ss){
        if(ss>=0&&ss<60){
            this.ss=ss;
        }
    }
    public static void main(String[] args) {
        Timer now = new Timer();
        now.setHh(23);
        now.setMm(70);
        now.setSs(56);
        System.out.println(now.getHh()+":"+now.getMm()+":"+now.getSs());
    }

}
